/**
 * @author tmh
 * @date 2024/10/24 16:26
 * @description
 */
public class T75颜色分类2 {
    public static void main(String[] args) {
        System.err.println(new int[]{2,0,2,1,1,0});
    }
    public static void sortColors(int[] nums) {
        int count0 =0;
        int count1=0;
        int count2=0;
        for (int num : nums) {
            if (num==0){
                count0++;
            }else if (num==1){
                count1++;
            }else {
                count2++;
            }
        }
        for (int i =0;i<count0;i++){
            nums[i]=0;
        }
        for (int i=count0;i<count0+count1;i++){
            nums[i]=1;
        }
        for (int i=count0+count1;i<count0+count1+count2;i++){
            nums[i]=2;
        }
    }
}
